import { request } from "@/utils"
import type { ResType } from '../types/global'
import { ChannelRes } from "@/types/channel"
import { ListRes, ReqParams } from "@/types/article"

// 请求频道列表
export function fetchChannelAPI() {
  return request<ResType<ChannelRes>>({
    url: '/channels',
  })
}

// 请求文章列表
export function fetchListAPI(params: ReqParams) {
  return request<ResType<ListRes>>({
    url: '/articles',
    params
  })
}